package com.hawthorn.redis.controller;

import com.hawthorn.redis.service.division.DivisionCacheService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>todo 行政区划缓存</p>
 * @author: andy.ten@tom.com | xukaixing@hotmail.com
 * @created: 2022/06/30 12:25 PM
 * @version v1.0.1
 * @copyright: Copyright (c)  andyten
 */
@Api(tags = {"redis-sysdivision"})
@RestController
@RequestMapping("/division")
@Slf4j
public class DivisionCacheController
{
  @Autowired
  private DivisionCacheService divisionCacheService;

  /**
   * <p>todo 重新加载行政区划</p>
   * @author: andy.ten@tom.com
   * @date: 2022/06/30 12:36 PM
   * @version: 1.0.1
   */
  @ApiOperation(value = "加载->重新初始化行政区划", notes = "重新初始化行政区划")
  @ApiImplicitParams({
  })
  @GetMapping(value = "reloadDivision")
  public void reloadDivision()
  {
    divisionCacheService.init();
  }
}
